package day05;

public class ForDemo {
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 1;i<=100;i++){
            sum = sum+i;
        }
        System.out.println("sum="+sum);
        /*
                        sum=0
         i=1            sum=1
         i=2            sum=1+2
         i=3            sum=1+2+3
         i=4            sum=1+2+3+4
         ...            sum=1+2+3+4...
         i=99           sum=1+2+3+4+...+99
         i=100          sum=1+2+3+4+...+99+100
         */



    }
}
